<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>Results - GeoLounge</title>

<link type="text/css" rel="stylesheet" href="brief.css"  />

</head>

<body>
<div id="header">
    <div id="geoLounge">
	  <img src="LogoSmall.gif" width="150px" height="25"px />
	</div>
	
	<ul id="nav" class="Style1">
	  <li class="STYLE1"><a href="brief2.php">Example</a></li>
	  <li class="STYLE1"><a href="geother.html" id="geother">Geother</a></li>
	  <li class="STYLE1"><a href="intro.html" id="intro">Intro</a></li>
	  <li class="STYLE1"><a href="index.html" id="home">Home</a></li>
	 
    </ul>
</div>

<form name="search" id="search" method="post" action="Brief2.php">
      <input name="theorem" type="text" id="textInput" />
	  <input name="buttom" type="submit" value="Search Theorems" id="go" />
    </form>

<div id="container">
	<div id="left">
	  <div id="sorry"><h2><br />Results</h2></div>
<p><?php
   
   require("db_mysql_2.php");
   $theorem = $_POST['theorem'];
   /*$definition = $_POST['definition'];*/ 
   $sql = "select * from theorems where Name LIKE '%$theorem%' OR Hypothesis LIKE '%$theorem%' OR Conclusion LIKE '%$theorem%'";
   $result =mysql_query($sql,$link);
   $result =mysql_query($sql,$link);
   if(mysql_num_rows($result)==0){
   echo "No Result";
     ?></p>

<?php
	 
	 }
	else {
        for($i=0; $i<mysql_num_rows($result); $i++){
	      $id = mysql_result($result,$i,'ID');
		  $title = mysql_result($result,$i,'Name');
          $pic =  mysql_result($result,$i,'picAddress');
          if(($pic) != NULL)
		  $havePic = "PIC";
		  else $havePic = NULL;
   
   ?>   
	 <a href="Example.php?ID=<?php echo $id; ?>"><p class="short"><?php echo $id; ?>:  <?php echo $title;?>  <red><?php echo "$havePic";?></red></p></a>
	 <?php }
     } ?>
     
     
		 
	</div>
	<div id="right">
	  <a href="advSearch.html"><img src="Logo2.gif" width="200" height="200" id="logo2"/></a>
	</div>
	</div>
<div id="blanc"></div>
<div id="footer">
    <ul class="STYLE1">
	  <li><a href="aboutUs.html">About Us</a></li>
	  <li><a href="http://www.buaa.edu.cn">Go to BUAA</a></li>
	</ul>
</div>
	  

	 
</body>
</html>
